package com.abel.quiz.common.vo;/**
 * Created by abel.lin on 2017/9/4.
 */

import com.alibaba.fastjson.JSON;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Date;

/**
 * @author abel.lin
 * @date_time 2017/9/4 10:50
 * @description
 */
public class WechatResp {
    private String isLogin;
    private String code;
    private String openId;
    private String token;
    private Date expireTime;
    private String msg;
    private Integer total;
    private Object data;

    public WechatResp(String isLogin){
        this.isLogin = isLogin;
    }
    public WechatResp(String isLogin,String msg){
        this.isLogin = isLogin;
        this.msg = msg;
    }

    public String toJson(){
        return JSON.toJSONString(this);
    }

    public void toWriter(HttpServletResponse response) throws IOException {
        response.setContentType("application/json;charset=utf-8");
        response.getWriter().print(JSON.toJSONString(this));
    }

    public String getIsLogin() {
        return isLogin;
    }

    public void setIsLogin(String isLogin) {
        this.isLogin = isLogin;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public Date getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Date expireTime) {
        this.expireTime = expireTime;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }
}
